import React, { Component } from 'react';
import {View, StatusBar} from 'react-native';
import { StackNavigator } from 'react-navigation';

import LibraryView from './src/LibraryView';
import PlaylistContentView from './src/PlaylistContentView';
import FullscreenAudioPlayerView from './src/FullscreenAudioPlayer';
import RecordingView from './src/RecordingView';
import QrCodeScannerView from './src/qrCodeScanner';
import UserProfileView from './src/UserProfileView';

import { dataManager } from './src/dataManager';

global.dataManager = dataManager;

global.dataManager.init();

global.playbackObject = 
{
  isPlaying: false,
  musicCounter: 0,
  indexOftheCurrentSoundTrack:0,
  // musicList: ['Rachmaninoff.mp3','Chinna.mp3','Kadhalar.aiff','Strawberry.aif'],
  currentSongName: '------',
  currentPlaylist: null,
  currentSoundTrack: null,
  currentSoundTrackDescription: null,
  currentPlaylistName: '-----',
  currentRepeatMode: 0,
  isShuffle: false,
}
global.userObject = undefined;

global.rnSound = require('react-native-sound');

global.rnSound.setCategory('Playback');

const MainStack = StackNavigator({
  Library: {
    screen: LibraryView
  },
  PlaylistContent: {
    screen: PlaylistContentView
  }
});

const RootStack = StackNavigator({
  Main: {
    screen: MainStack
  },
  FullscreenAudioPlayer: {
    screen: FullscreenAudioPlayerView
  },
  QrCodeScanner: {
    screen: QrCodeScannerView
  },
  Recording: {
    screen: RecordingView
  },
  profileView :{
    screen: UserProfileView
  }
}, {
  mode: 'modal',
  headerMode: 'none'
})

const App = () => (
  <View style={{flex:1}}>
    <StatusBar barStyle="light-content" />
    <RootStack />
  </View>);


export default App;
